﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        var arr = [1, 2, 3];
       
        //function incl(num) {
        //    for (var i of arr) {
        //        if (num == i) {
        //            return true;
        //        } else {
        //            return false;
        //        }
        //    }
        //}
        Array.prototype.includes1 = function (num) {
            for (var i of arr) {
                if (num == i) {
                    return true;
                } else {
                    return false;
                }
            }
        }
        var n = arr.includes1(4);
        console.log(n);
          /*  console.log(incl(2)); */
    </script>
</body>
</html>